package inutan.common.inner.protocol;

import org.ricks.protocol.IPacket;
import org.ricks.protocol.Protocol;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

@Protocol(id = 50)
public final class InnerMessage implements IPacket {
    public byte modularId;
    public byte state;
    public short cmd;
    public long userId;
    public long userSessionId;
    public int packageId;
    public short responseStatus;
    public byte[] data;
    public String groupId;

    /**
     * key=房间类型
     * value=groupId 分组ID
     * 维护房间绑定关系，每次请求传给flowcontext
     * 朝生夕死，社团聊天属于社团功能
     */
    private Map<Byte,String> roomMap = new HashMap<>();
    public Set<Long> toUserIds;

    public byte getModularId() {
        return modularId;
    }

    public void setModularId(byte modularId) {
        this.modularId = modularId;
    }

    public byte getState() {
        return state;
    }

    public void setState(byte state) {
        this.state = state;
    }

    public short getCmd() {
        return cmd;
    }

    public void setCmd(short cmd) {
        this.cmd = cmd;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public long getUserSessionId() {
        return userSessionId;
    }

    public void setUserSessionId(long userSessionId) {
        this.userSessionId = userSessionId;
    }

    public int getPackageId() {
        return packageId;
    }

    public void setPackageId(int packageId) {
        this.packageId = packageId;
    }

    public short getResponseStatus() {
        return responseStatus;
    }

    public void setResponseStatus(short responseStatus) {
        this.responseStatus = responseStatus;
    }

    public byte[] getData() {
        return data;
    }

    public void setData(byte[] data) {
        this.data = data;
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public Set<Long> getToUserIds() {
        return toUserIds;
    }

    public void setToUserIds(HashSet<Long> toUserIds) {
        this.toUserIds = toUserIds;
    }

    public Map<Byte, String> getRoomMap() {
        return roomMap;
    }

    public void setRoomMap(Map<Byte, String> roomMap) {
        this.roomMap = roomMap;
    }

    public void setToUserIds(Set<Long> toUserIds) {
        this.toUserIds = toUserIds;
    }

    public void setRoomMap(HashMap<Byte, String> roomMap) {
        this.roomMap = roomMap;
    }

    @Override
    public String toString() {
        return "{ "
                + "state:" + state + ","
                + "cmd:" + cmd + ","
                + "userId:" + userId + ","
                + "userSessionId:" + userSessionId + ","
                + "packageId:" + packageId + ","
                + "responseStatus:" + responseStatus + ","
                + "data:" + data + ","
                + "groupId:" + groupId + ","
                + "toUserIds:" + toUserIds + ","
                + "}";
    }

}
